﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace GPSTracker.API.WCFService
{
    public class GPSServiceREST : IGPSServiceREST
    {
        //---------- Login  -------------------------
        public DataModel.SP_CheckLoginByTempoResult CheckLoginByTempo(DataModel.ClientData cd)
        {
            return DAL.LoginDAL.CheckLoginByTempo(cd.LoginName, cd.LoginPwd, "CheckLoginByTempo");
        }

        public DataModel.SP_CheckLoginResult CheckLoginByMobile(DataModel.ClientData cd)
        {
            return DAL.LoginDAL.CheckLoginByMobile(cd.LoginName, cd.LoginPwd, "CheckLoginByMobile");
        }


        //---------- MASTER  -------------------------
        public List<DataModel.SP_GetBranches_RESTResult> GetBranches(DataModel.ClientData cd)
        {
            return DAL.MasterDAL.GetBranches(cd);
        }

        public List<DataModel.SP_GetWarehouse_RESTResult> GetWarehouse(DataModel.ClientData cd)
        {
            return DAL.MasterDAL.GetWarehouse(cd);
        }

        public List<DataModel.SP_GetTempos_RESTResult> GetTempos(DataModel.ClientData cd)
        {
            return DAL.MasterDAL.GetTempos(cd);
        }


        //---------- GPS  -------------------------
        public bool AddGpsData(DataModel.ClientData cd)
        {
            return DAL.GpsDAL.AddGpsData(cd);
        }

        public List<DataModel.VW_GpsData> GetAllGpsData()
        {
            return DAL.GpsDAL.GetAllGpsData();
        }

        public List<DataModel.SP_GetTempoGPSPath_RESTResult> GetTempoGPSPath(DataModel.ClientData cd)
        {
            return DAL.GpsDAL.GetTempoGPSPath(cd);
        }


        //---------- Delivery TRANS  -------------------------
        public List<DataModel.SP_GetReadyDelivery_RESTResult> GetReadyDeliveryData(DataModel.ClientData cd)
        {
            return DAL.DeliveryDAL.GetReadyDeliveryData(cd);
        }

        public bool SaveDeliveryStatus(DataModel.ClientData cd, List<DataModel.ClientData> listCD)
        {
            return DAL.DeliveryDAL.SaveDeliveryStatus(cd, listCD);
        }


        //---------- REPORT  -------------------------
        public List<DataModel.SP_GetAllActiveTempoOnField_RESTResult> GetAllActiveTempoOnField(DataModel.ClientData cd)
        {
            return DAL.ReportDAL.GetAllActiveTempoOnField(cd);
        }

        public List<DataModel.SP_GetDeliveredReport_RESTResult> GetDeliveredReport(DataModel.ClientData cd)
        {
            return DAL.ReportDAL.GetDeliveredReport(cd);
        }
    }
}
